#region OpenNETCF Copyright Information
/*
Copyright (c) 2007 OpenNETCF Consulting, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial 
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#endregion

using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Text;
using OpenNETCF.WindowsMobile.Ink;

namespace OpenNETCF.WindowsMobile.Ink.Interfaces
{
    [
        ComImport,
        Guid("B82A463B-C1C5-45A3-997C-DEAB5651B67A"),
        InterfaceType(ComInterfaceType.InterfaceIsDual)
    ]
    public interface IInkOverlay
    {
        /// <summary>
        /// Gets the window handle that the control is bound to
        /// </summary>
        /// <returns></returns>
        [DispId(0x00000002)]
        IntPtr hWnd { get; set;}
        /// <summary>
        /// Returns or sets a value that specifies whether the InkCollector or InkOverlay objects will collect pen input (in-air packets, cursor in range events, and so on)
        /// </summary>
        /// <returns></returns>
        [DispId(0x00000001)]
        bool Enabled { get; set;}
        /// <summary>
        /// Returns or sets the default drawing attributes to use when drawing and displaying ink
        /// </summary>
        [DispId(0x00000005)]
        IInkDrawingAttributes DefaultDrawingAttributes { get; set; }
        /// <summary>
        /// Returns or sets the Renderer object that is used to draw ink.
        /// </summary>
        [DispId(0x00000006)]
        /*IInkRenderer*/
        IntPtr Renderer { get; set;}
        /// <summary>
        /// Returns or sets the Ink object that is associated with an InkCollector object, an InkOverlay object, or a InkPicture control
        /// </summary>
        [DispId(0x00000007)]
        IInkDisp Ink { get; set;}
        /// <summary>
        /// Gets or sets a value that specifies whether an IInkOverlay control repaints the ink when the window is invalidated
        /// </summary>
        [DispId(0x00000008)]
        bool AutoRedraw { get; set;}
        /// <summary>
        /// Returns the value that specifies whether ink is currently being drawn
        /// </summary>
        [DispId(0x00000009)]
        bool CollectingInk { get;}
        /// <summary>
        /// Returns or sets the collection mode that determines whether ink, gestures, or both are recognized as the user writes
        /// </summary>
        [DispId(0x0000001c)]
        InkCollectionMode CollectionMode { get; set;}
        /// <summary>
        /// Returns or sets the value that specifies whether ink is rendered as it is drawn
        /// </summary>
        [DispId(0x0000001f)]
        bool DynamicRendering { get; set; }
        /// <summary>
        /// Returns or sets a value that specifies whether the object/control is in ink mode, deletion mode, or selecting/editing mode
        /// </summary>
        [DispId(0x0000000c)]
        InkOverlayEditingMode EditingMode { get; set; }
        /// <summary>
        /// Returns the collection of strokes that are currently selected inside the control
        /// </summary>
        [DispId(0x0000000d)]
        IInkStrokes Selection { get; set; }
        /// <summary>
        /// Returns or sets the value that specifies whether ink is erased by stroke or by point
        /// </summary>
        [DispId(0x00000021)]
        InkOverlayEraserMode EraserMode { get; set; }
        /// <summary>
        /// Returns or sets the value that specifies width of the eraser pen tip
        /// </summary>
        /// <summary>
        /// Returns or sets a value that specifies whether ink will be rendered as just one color when the system is in High Contrast mode
        /// </summary>
        [DispId(0x00000026)]
        bool SupportHighContrastInk { get; set;}
        /// <summary>
        /// Returns or sets a value that specifies whether all selection UI (selection bounding box, 
        /// selection handles) will be drawn in high contrast when the system is in High Contrast mode
        /// </summary>
        [DispId(0x00000027)]
        bool SupportHighContrastSelectionUI { get; set;}

        /// <summary>
        /// Specifies the ink and selection UI to draw for a specified rectangle in the provided Graphics object (screen, printer, and so on)
        /// </summary>
        /// <param name="Rect"></param>
        /// <returns></returns>
        [DispId(0x00000010)]
        void Draw(IInkRectangle Rect);

        /// <summary>
        /// Specifies the window rectangle, in pixels, within which ink is drawn
        /// </summary>
        /// <param name="WindowInputRectangle"></param>
        [DispId(0x00000018)]
        IInkRectangle GetWindowInputRectangle();

        /// <summary>
        /// Specifies the window rectangle, in pixels, to use to map drawn ink to the window
        /// </summary>
        /// <param name="WindowInputRectangle"></param>
        [DispId(0x00000017)]
        void SetWindowInputRectangle(IInkRectangle WindowInputRectangle);

        /// <summary>
        /// Specifies the current state of a particular InkCollector, InkOverlay, 
        /// or InkPicture event (whether the event is being listened for, or used)
        /// </summary>
        /// <param name="EventId"></param>
        /// <returns></returns>
        [DispId(0x0000000b)]
        bool GetEventInterest(InkCollectorEventInterest EventId);

        /// <summary>
        /// Specifies whether a specific event should be listened for, or used
        /// </summary>
        /// <param name="EventId"></param>
        /// <param name="Listen"></param>
        [DispId(0x0000000a)]
        void SetEventInterest(InkCollectorEventInterest EventId, bool Listen);
    }

    public enum InkCollectorEventInterest
    {
        DefaultEvents = -1,
        Stroke = DefaultEvents + 1,
        MouseDown = Stroke + 1,
        MouseMove = MouseDown + 1,
        MouseUp = MouseMove + 1,
        DblClick = MouseUp + 1,
        AllEvents = DblClick + 1
    }

    public enum InkOverlayEditingMode
    {
        Ink = 0,
        Delete = 1,
        Select = 2
    }

    public enum InkOverlayEraserMode
    {
        StrokeErase = 0
    }
    
    public enum InkCollectionMode
    {
        InkOnly = 0
    }
}
